var SelectCount=0;  //用户选择的记录数
var SelectList="";  //用户选择的记录Id列表

//选择情况检查
function CheckSelect()
{
	SelectCount=0;
	SelectList="";
	var size=document.all.length ;
	for(i=0;i<size;i++)
	{
		var obj=document.all.item(i);
		if(obj.type=="checkbox" & obj.name!="")
		{
			if(obj.checked==true &  obj.name.indexOf("selectID")>=0 )
			{
				SelectCount++;
				if (SELECTCOUNT>1) 
				{
					SelectList+=";";
				}
				SelectList+=obj.value;
			}
		}

	}
	return SelectCount;     
}  
	
	
	/*
	    打开页面：
	    sUrl:目标页面相对地址
	    sAction:自定义：查询字符串，如add,update,
	    sValue:查询值
	
	*/
	function Execufunction(sUrl,sAction,sValue)
	{
	  var intSelectCount;
	  intSelectCount=CheckSelect();
	  if (intSelectCount!=1)
	  {
	    alert("请选择一条记录！");
	  }
	  else
	  {
	     var sOpenString=sUrl+'?'+sAction+'='+sValue;
	     window.open(sOpenString);
	  }
	    // var obj=window.open(sUrl,"_new",getOpenWindowFeature(560,350));
	}	
	
	
	function Linkfunction(sUrl,sAction)
	{
	  var intSelectCount;
	  intSelectCount=CheckSelect();
	  if (intSelectCount!=1)
	  {
	    alert("请选择一条记录！");
	  }
	  else
	  {
	     var sOpenString=sUrl+'?'+sAction+'='+SelectList;
	     window.open(sOpenString);
	  }
	    // var obj=window.open(sUrl,"_new",getOpenWindowFeature(560,350));
	}	
